package com.sixth.volunteerservicesystem.Controller.DonationController.backDonation;

import com.sixth.volunteerservicesystem.Dao.DonationRepository;
import com.sixth.volunteerservicesystem.domain.DonationProjects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Steve Jobs
 * @create 2021-01-10 13:28
 */
@Controller
public class Donationlist {

    @Autowired
    DonationRepository donationRepository;

    @RequestMapping("/backDonationList")
    public String donationList(Model model){
        List<DonationProjects> list = new ArrayList<>();

        list = donationRepository.findAll();

        model.addAttribute("item",list);



        return "backstageDonation/backDonation";
    }

}
